package net.wangds.spring.app;

import net.wangds.utils.DateUtils;
import net.wangds.log.helper.LogHelper;
import org.springframework.beans.factory.InitializingBean;

import java.util.Date;

public abstract class AbstractApplication implements InitializingBean {


    public String getApplicationName(){
        return System.getProperty("application.name");
    }

    public abstract void initializing();

    public void showServerInfo(){
        LogHelper.info("服务器时间:"+ DateUtils.toFullTimeStr(new Date()));
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        LogHelper.info("应用\""+getApplicationName()+"\"加载完毕。");
        showServerInfo();
        initializing();
    }

}
